﻿@model WebUI.Models.QizSubjectDefine
@using (Ajax.BeginForm(new AjaxOptions()
{
    LoadingElementId="OnLoadingSpan",UpdateTargetId = ViewBag.utid,
    InsertionMode = System.Web.Mvc.Ajax.InsertionMode.Replace,
    HttpMethod = "Post",
    OnSuccess = "$('#dialogbox').dialog('close');",
    OnFailure = "OnSiteError"
}))
{
    @Html.HiddenFor(model => model.ID)
    <h3>
        只用关联指标选定指定的关联值时，当前问题才询问。</h3>
    <div class="editor-label">
        关联指标:
    </div>
    <div class="editor-field">
        <script type="text/javascript">
            function reloadvalues(val) {
                //if (val&&val!="") {
                    var requrl = '@(Url.Action("SftMingXiEnumTypeValus"))/';
                    $.ajax({
                        url: requrl + val
                    , success: function (data) { $('#enum_listview').html(data); }
                    });
                //}
            }
            
        </script>
        @Html.DropDownListFor(model => model.ParentSubjDefID, new SelectList((ViewBag.Selections as IEnumerable<QizSubjectDefine>).Select(v => new { ID = v.ID, Title = v.QizItem.Title }), "ID", "Title", Model.ParentSubjDefID), "--不关联--", new { onchange = "reloadvalues(this.value);"})
    </div>
    <div class="editor-label">
        关联选则:
    </div>
    <div class="editor-field" id="enum_listview">
        @if (string.IsNullOrEmpty(Model.ParentSubjDefID))
        {
            <span> 请先选择关联指标。</span>
        }
        else { 
            @Html.Action("SftMingXiEnumTypeValus", new { ID = Model.ParentSubjDefID,srcID=Model.ID })
        }
    </div>
    <p>
        <input class="ui-button" type="submit" value="保存" />
    </p>
    
}